<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>安装数量</title>
    <script src="./js/package/dist/echarts.js"></script>
</head>
<body>
    <div id="main" style="width: 415px;height:250px;background-color: #211543;"></div>
    <script>
        var chartDom = document.getElementById('main');
        var myChart = echarts.init(chartDom);
        var option;

        option = {
            tooltip:{

            },
            xAxis: {
                type: 'category',
                data: ['金华', '义乌','东阳' ,'兰溪', '浦江', '磐安', '塔石', '新狮','武义'],
                axisLine:{
                    lineStyle:{
                        color:'#673fb9' //x轴的颜色
                    }
                }
            },
            yAxis: {
                type: 'value',
                axisLine:{
                    lineStyle:{
                        color:'#673fb9' //y轴的颜色 
                    }
                },
                splitLine:{
                    show:false
                }
            },
            series: [
                {
                    data: [120, 200, 150, 80, 70, 110, 130,200,50],
                    type: 'bar',
                    showBackground: true,
                    backgroundStyle: {
                        color: '#2e1f5a',
                        borderRadius: [10, 10, 0, 0] 
                    },
                    itemStyle:{
                        // color:"#f7e239",
                        // 渐变处理
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            { offset: 0, color: '#06ffff' },
                            { offset: 0.5, color: '#0adaff' },
                            { offset: 1, color: '#10c4f9' }
                        ]),
                        borderRadius: [10, 10, 0, 0]
                    },
                    barWidth:"15"
                }
            ]
        };

        option && myChart.setOption(option);
    </script>
</body>
</html>